Skip to content

Comments

fix: handle zero-token KV cache expansion#504

Open
livepeer-robot wants to merge 1 commit intodaydreamlive:mainfrom
livepeer-robot:fix/issue-500
Open

fix: handle zero-token KV cache expansion#504
livepeer-robot wants to merge 1 commit intodaydreamlive:mainfrom
livepeer-robot:fix/issue-500

Conversation

@livepeer-robot
Copy link

Add guard clauses to skip processing when the token/frame count is zero, preventing tensor dimension mismatches during KV cache expansion (e.g. expanded size (0) must match existing size).

Guards added in:

  • DenoiseBlock: skip denoising loop when num_frames == 0
  • CleanKVCacheBlock: skip cache cleaning when num_frames == 0
  • RecacheFramesBlock: skip recaching when num_recache_frames == 0
  • causal_rope_apply: pass through when seq_len == 0

Fixes #500

Add guard clauses to skip processing when the token/frame count is zero,
preventing tensor dimension mismatches during KV cache expansion
(e.g. 'expanded size (0) must match existing size').

Guards added in:
- DenoiseBlock: skip denoising loop when num_frames == 0
- CleanKVCacheBlock: skip cache cleaning when num_frames == 0
- RecacheFramesBlock: skip recaching when num_recache_frames == 0
- causal_rope_apply: pass through when seq_len == 0

Fixes daydreamlive#500
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KV cache tensor dimension mismatch in DenoiseBlock/RecacheFramesBlock when target size is zero

1 participant